3.107 \(\int \frac {a+b x^2}{1+x^2} \, dx\)

Optimal. Leaf size=12 \[ (a-b) \tan ^{-1}(x)+b x \]

[Out]

b*x+(a-b)*arctan(x)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {388, 203} \[ (a-b) \tan ^{-1}(x)+b x \]

Antiderivative was successfully verified.

[In]

Int[(a + b*x^2)/(1 + x^2),x]

[Out]

b*x + (a - b)*ArcTan[x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rubi steps

\begin {align*} \int \frac {a+b x^2}{1+x^2} \, dx &=b x-(-a+b) \int \frac {1}{1+x^2} \, dx\\ &=b x+(a-b) \tan ^{-1}(x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 12, normalized size = 1.00 \[ (a-b) \tan ^{-1}(x)+b x \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x^2)/(1 + x^2),x]

[Out]

b*x + (a - b)*ArcTan[x]

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 12, normalized size = 1.00 \[ b x + {\left (a - b\right )} \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(x^2+1),x, algorithm="fricas")

[Out]

b*x + (a - b)*arctan(x)

________________________________________________________________________________________

giac [A]  time = 0.35, size = 12, normalized size = 1.00 \[ b x + {\left (a - b\right )} \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(x^2+1),x, algorithm="giac")

[Out]

b*x + (a - b)*arctan(x)

________________________________________________________________________________________

maple [A]  time = 0.00, size = 14, normalized size = 1.17 \[ a \arctan \relax (x )+b x -b \arctan \relax (x ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^2+a)/(x^2+1),x)

[Out]

b*x+arctan(x)*a-arctan(x)*b

________________________________________________________________________________________

maxima [A]  time = 2.29, size = 12, normalized size = 1.00 \[ b x + {\left (a - b\right )} \arctan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(x^2+1),x, algorithm="maxima")

[Out]

b*x + (a - b)*arctan(x)

________________________________________________________________________________________

mupad [B]  time = 0.08, size = 12, normalized size = 1.00 \[ b\,x+\mathrm {atan}\relax (x)\,\left (a-b\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x^2)/(x^2 + 1),x)

[Out]

b*x + atan(x)*(a - b)

________________________________________________________________________________________

sympy [C]  time = 0.16, size = 26, normalized size = 2.17 \[ b x - \frac {i \left (a - b\right ) \log {\left (x - i \right )}}{2} + \frac {i \left (a - b\right ) \log {\left (x + i \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x**2+a)/(x**2+1),x)

[Out]

b*x - I*(a - b)*log(x - I)/2 + I*(a - b)*log(x + I)/2

________________________________________________________________________________________